﻿using System;
using System.Collections.Generic;
using BLL;
using Model;

public partial class ViewbyProduct_ViewFailCategory : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.CrystalReportSource1.ReportDocument.Load(Server.MapPath("ViewFail.rpt"));
        CrystalReportSource1.ReportDocument.SetDatabaseLogon("sa", "123", @"10.53.6.28\SQLEXPRESS", "ATE");
        //CrystalReportSource1.ReportDocument.SetParameterValue("@ProductTypeID", "AGX18");
        //CrystalReportSource1.ReportDocument.SetParameterValue("@starttime", DateTime.Parse("2012-03-14 21:53:00"));
        //CrystalReportSource1.ReportDocument.SetParameterValue("@stoptime", DateTime.Parse("2012-03-19 21:53:00"));
        CrystalReportSource1.DataBind();
        this.CrystalReportViewer1.ReportSource = this.CrystalReportSource1;
        this.CrystalReportViewer1.DataBind();

        this.CrystalReportSource2.ReportDocument.Load(Server.MapPath("ViewFail1.rpt"));
        CrystalReportSource2.ReportDocument.SetDatabaseLogon("sa", "123", @"10.53.6.28\SQLEXPRESS", "ATE");
        CrystalReportSource2.DataBind();
        this.CrystalReportViewer2.ReportSource = this.CrystalReportSource2;
        this.CrystalReportViewer2.DataBind();

        //CrystalReportSource3.ReportDocument.Load(Server.MapPath("ViewFail2.rpt"));        
        //DataSet list = GetTestData();   
        //CrystalReportSource3.ReportDocument.SetDataSource(list);
        //CrystalReportSource2.ReportDocument.SetDatabaseLogon("sa", "123", @"10.53.6.28\SQLEXPRESS", "ATE");
        //CrystalReportSource3.DataBind();
        //this.CrystalReportViewer3.ReportSource = CrystalReportSource3;
        //CrystalReportViewer3.DataBind();

        this.GridView1.DataSource = GetTestData();
        this.GridView1.DataBind();
    }

    public IList<ProductTypeInfo> GetTestData()
    {
        ProductType pt = new ProductType();
        return pt.LoadEntities();
    }
}
